- 31 Aug, 2016 1 commit
-
-
winniehell authored
-
- 30 Aug, 2016 1 commit
-
-
http://jneen.net/ authored
-
- 14 Aug, 2016 1 commit
-
-
Ahmad Sherif authored
In Banzai::Filter::SanitizationFilter#customize_whitelist, we append three lambdas that has reference to the SanitizationFilter instance, which in turn (potentially) has a reference to the following chain: context hash -> Project instance -> Repository instance -> lookup hash -> various Rugged instances -> various mmap-ed git pack files. All of the above is not garbage collected because the array we append the lambdas to is the constant HTML::Pipeline::SanitizationFilter::WHITELIST.
-
- 06 Aug, 2016 2 commits
-
-
Gabriel Mazetto authored
-
Gabriel Mazetto authored
-
- 04 Aug, 2016 1 commit
-
-
winniehell authored
-
- 03 Aug, 2016 2 commits
-
-
Yorick Peterse authored
By using Rouge::Lexer.find instead of find_fancy() and memoizing the HTML formatter we can speed up the highlighting process by between 1.7 and 1.8 times (at least when measured using synthetic benchmarks). To measure this I used the following benchmark: require 'benchmark/ips' input = '' Dir['./app/controllers/**/*.rb'].each do |controller| input << <<-EOF <pre><code class="ruby">#{File.read(controller).strip}</code></pre> EOF end document = Nokogiri::HTML.fragment(input) filter = Banzai::Filter::SyntaxHighlightFilter.new(document) puts "Input size: #{(input.bytesize.to_f / 1024).round(2)} KB" Benchmark.ips do |bench| bench.report 'call' do filter.call end end This benchmark produces 250 KB of input. Before these changes the timing output would be as follows: Calculating ------------------------------------- call 1.000 i/100ms ------------------------------------------------- call 22.439 (±35.7%) i/s - 93.000 After these changes the output instead is as follows: Calculating ------------------------------------- call 1.000 i/100ms ------------------------------------------------- call 41.283 (±38.8%) i/s - 148.000 Note that due to the fairly high standard deviation and this being a synthetic benchmark it's entirely possible the real-world improvements are smaller.
-
Yorick Peterse authored
By using clever XPath queries we can quite significantly improve the performance of this method. The actual improvement depends a bit on the amount of links used but in my tests the new implementation is usually around 8 times faster than the old one. This was measured using the following benchmark: require 'benchmark/ips' text = '<p>' + Note.select("string_agg(note, '') AS note").limit(50).take[:note] + '</p>' document = Nokogiri::HTML.fragment(text) filter = Banzai::Filter::AutolinkFilter.new(document, autolink: true) puts "Input size: #{(text.bytesize.to_f / 1024 / 1024).round(2)} MB" filter.rinku_parse Benchmark.ips(time: 15) do |bench| bench.report 'text_parse' do filter.text_parse end bench.report 'text_parse_fast' do filter.text_parse_fast end bench.compare! end Here the "text_parse_fast" method is the new implementation and "text_parse" the old one. The input size was around 180 MB. Running this benchmark outputs the following: Input size: 181.16 MB Calculating ------------------------------------- text_parse 1.000 i/100ms text_parse_fast 9.000 i/100ms ------------------------------------------------- text_parse 13.021 (±15.4%) i/s - 188.000 text_parse_fast 112.741 (± 3.5%) i/s - 1.692k Comparison: text_parse_fast: 112.7 i/s text_parse: 13.0 i/s - 8.66x slower Again the production timings may (and most likely will) vary depending on the input being processed.
-
- 02 Aug, 2016 2 commits
-
-
winniehell authored
-
winniehell authored
-
- 29 Jul, 2016 1 commit
-
-
Yorick Peterse authored
The method Ability.issues_readable_by_user takes a list of users and an optional user and returns an Array of issues readable by said user. This method in turn is used by Banzai::ReferenceParser::IssueParser#nodes_visible_to_user so this method no longer needs to get all the available abilities just to check if a user has the "read_issue" ability. To test this I benchmarked an issue with 222 comments on my development environment. Using these changes the time spent in nodes_visible_to_user was reduced from around 120 ms to around 40 ms.
-
- 26 Jul, 2016 1 commit
-
-
Rémy Coutable authored
Signed-off-by: Rémy Coutable <remy@rymai.me>
-
- 21 Jul, 2016 1 commit
-
-
Ahmad Sherif authored
See #19985
-
- 20 Jul, 2016 2 commits
-
-
Grzegorz Bizon authored
Avoid multi-line ?: (the ternary operator). Use if/unless instead. See #17478
-
Rémy Coutable authored
Handle videos in: - MD preview in notes: commit, issue/MR, MR diff - New notes in: commit, issue/MR, MR diff - Persisted notes in: commit, issue/MR, MR diff Signed-off-by: Rémy Coutable <remy@rymai.me>
-
- 19 Jul, 2016 6 commits
-
-
Rémy Coutable authored
Also, always add a link to download videos since video playback is tricky. Also, it solves the issue with email client not supporting videos. Signed-off-by: Rémy Coutable <remy@rymai.me>
-
Rémy Coutable authored
Signed-off-by: Rémy Coutable <remy@rymai.me>
-
Eric Hayes authored
* Registered video MIME types * Currently supporting browser-supported formats with extensions that match the mime type
-
Grzegorz Bizon authored
-
Grzegorz Bizon authored
-
Grzegorz Bizon authored
-
- 18 Jul, 2016 1 commit
-
-
Paco Guzman authored
-
- 16 Jul, 2016 1 commit
-
-
Douwe Maan authored
-
- 15 Jul, 2016 1 commit
-
-
http://jneen.net/ authored
-
- 14 Jul, 2016 5 commits
-
-
winniehell authored
-
http://jneen.net/ authored
-
http://jneen.net/ authored
-
http://jneen.net/ authored
-
http://jneen.net/ authored
-
- 13 Jul, 2016 1 commit
-
-
Paco Guzman authored
-
- 12 Jul, 2016 1 commit
-
-
Paco Guzman authored
-
- 11 Jul, 2016 1 commit
-
-
Stan Hu authored
have been fully redacted and contain cross-project references. The previous implementation relied on Note#cross_reference_not_visible_for?, which essentially tries to render all the Markdown references in a system note and only displays the note if the user can see the referring project. But this duplicated the work that Banzai::NotesRenderer was doing already. Instead, for each note we render, we memoize the number of visible user references and use it later if it is available. Improves #19273
-
- 10 Jul, 2016 2 commits
-
-
Douwe Maan authored
-
Douwe Maan authored
-
- 08 Jul, 2016 1 commit
-
-
Yorick Peterse authored
This caches various queries to ensure that multiple reference extraction runs re-use any objects queried in previous runs.
-
- 05 Jul, 2016 3 commits
-
-
Douglas Barbosa Alexandre authored
-
Douglas Barbosa Alexandre authored
-
Douglas Barbosa Alexandre authored
-
- 01 Jul, 2016 2 commits
-
-
Grzegorz Bizon authored
-
Paco Guzman authored
-