Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chromium compile doesn't seem to be using ccache
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2745

PostPosted: Sun Feb 16, 2025 10:26 am    Post subject: Reply with quote

https://wiki.gentoo.org/wiki/Ccache
Back to top
View user's profile Send private message
user
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 223

PostPosted: Sun Feb 16, 2025 11:22 am    Post subject: Reply with quote

logrusx wrote:
https://wiki.gentoo.org/wiki/Ccache

Code:
 * Contents of dev-util/ccache-4.10.2-r1:
/usr
/usr/bin
/usr/bin/ccache
/usr/bin/ccache-config
/usr/share
/usr/share/doc
/usr/share/doc/ccache-4.10.2-r1
/usr/share/doc/ccache-4.10.2-r1/AUTHORS.adoc.lz
/usr/share/doc/ccache-4.10.2-r1/CONTRIBUTING.md.lz
/usr/share/doc/ccache-4.10.2-r1/MANUAL.adoc.lz
/usr/share/doc/ccache-4.10.2-r1/NEWS.adoc.lz
/usr/share/doc/ccache-4.10.2-r1/README.md.lz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/ccache.1.lz
/usr/share/shadowman
/usr/share/shadowman/tools
/usr/share/shadowman/tools/ccache

no portage-ccache
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 142

PostPosted: Sun Feb 16, 2025 12:12 pm    Post subject: Reply with quote

user wrote:
Which package provide "portage-ccache" ?


Nothing, it's just a script I made that does nothing more than automatically setting the CCACHE_DIR environment variable.

The important part is this part of /etc/portage/bashrc:

Code:
if [[ ${FEATURES} == *ccache* && ${EBUILD_PHASE_FUNC} == src_* ]]; then
   export CCACHE_BASEDIR="${PORTAGE_TMPDIR}/portage"
   if [[ ${CCACHE_DIR} == /var/cache/portage/ccache ]]; then
      if [[ ${CATEGORY} == kde-frameworks ]]; then
         export CCACHE_DIR=${CCACHE_DIR}/${CATEGORY}
      else
         export CCACHE_DIR=${CCACHE_DIR}/${CATEGORY}/${PN}
      fi
      mkdir -p "${CCACHE_DIR}" || die
   fi
fi


Which assigns each package it's own private cache in /var/cache/portage/ccache for better statistics and monitoring.
_________________
execctl --path exec filectl --current-directory list
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2745

PostPosted: Sun Feb 16, 2025 4:41 pm    Post subject: Reply with quote

mi_unixbird wrote:

As in: “prefix_command_cpp=/usr/local/libexec/ccache_pp_wrapper” with this simply executing “exec "$@" -P” and nothing more. It seems like this change makes a lot of packages which didn't work well with upgrades compile get a high hit ratio.


Where do you put that?

Best Regards,
Georgi
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 142

PostPosted: Sun Feb 16, 2025 6:48 pm    Post subject: Reply with quote

logrusx wrote:
mi_unixbird wrote:

As in: “prefix_command_cpp=/usr/local/libexec/ccache_pp_wrapper” with this simply executing “exec "$@" -P” and nothing more. It seems like this change makes a lot of packages which didn't work well with upgrades compile get a high hit ratio.


Where do you put that?

Best Regards,
Georgi
In the /etc/ccache.conf or local per-cache configuration.

https://ccache.dev/manual

The “prefix_command_cpp” option and the configuration style syntax is explained here.
_________________
execctl --path exec filectl --current-directory list
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2745

PostPosted: Mon Feb 17, 2025 5:33 pm    Post subject: Reply with quote

Thanks. I almost filled the cache, only a few thousand units remain until the compilation completes. We'll see what happens on the next release. I've never had good results with ccache, but I remain optimistic. No big hoes though.

EIDT: it finished. Cache size is 2.1 Gb. It even had 2 cache hits during the compilation. However I'm disappointed. Three years after they enabled Wayland support and Chromium still does not allow me to select more than 1080p YouTube video quality, while Firefox has been supporting it for quite a while now. I've abandoned Chromium for more than a year and I'm doing this out of curiosity only.

Best Regards,
Georgi
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2745

PostPosted: Thu Feb 20, 2025 10:49 am    Post subject: Reply with quote

I don't know what I'm doing wrong but I've never got good cache hit ratios with chromium. Some people claimed they sometimes had good rates even without the change you suggested in the past, but I never did. I used ungoogled chromium for this experiment and I terminated it third of the way with abysmal 10% hit rate. Yes, 10% is more than I've ever had, but I don't think it's worth.

This time mesa was pulled in and I enabled cache for it too and I'll see how it does next update.

Best Regards,
Georgi
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 142

PostPosted: Fri Feb 21, 2025 7:25 pm    Post subject: Reply with quote

logrusx wrote:
I don't know what I'm doing wrong but I've never got good cache hit ratios with chromium. Some people claimed they sometimes had good rates even without the change you suggested in the past, but I never did. I used ungoogled chromium for this experiment and I terminated it third of the way with abysmal 10% hit rate. Yes, 10% is more than I've ever had, but I don't think it's worth.

This time mesa was pulled in and I enabled cache for it too and I'll see how it does next update.

Best Regards,
Georgi


My ccache.conf for chromium looks like this, not sure whether you forgot a setting:

Code:
# Maximum cache size to maintain
max_size = 5.0G

# Allow others to run 'ebuild' and share the cache.
umask = 002

# Preserve cache across GCC rebuilds and
# introspect GCC changes through GCC wrapper.
compiler_check = %compiler% -dumpversion

# I expect 1.5M files. 300 files per directory.
cache_dir_levels = 3

cache_dir = /var/cache/portage/ccache/www-client/chromium

file_clone=true
depend_mode=false
direct_mode=false
hash_dir=false
run_second_cpp=false


I don't use the strip preprocessor hack for chromium because it doesn't do anything for it, I only use it for other packages.

The only time i get sub 10% hits is if some kind of fundamental dependency like the compiler itself updated and the entire cache is invalidated. With normal updates it rarely drops below 80%
_________________
execctl --path exec filectl --current-directory list
Back to top
View user's profile Send private message
keekkenen
n00b
n00b


Joined: 05 Oct 2024
Posts: 33

PostPosted: Fri Feb 21, 2025 10:01 pm    Post subject: Reply with quote

logrusx wrote:
Three years after they enabled Wayland support and Chromium still does not allow me to select more than 1080p YouTube video quality, while Firefox has been supporting it for quite a while now.

It's very strange, I've no problem with 1440p and 2160p in Chromium under plasma with wayland.
_________________
7950x3d / x670e MSI Tomagawk / Sapphire RX 7800XT 16Gb / G.Skill 64Gb 5600 / A-Data Legend 960 2Tb (x2), A-Data SX8200PNP 256Gb
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum